package com.qingke.easyjava.calculator;

public class OperatorFactory {

    public Operator buildOperator(String operator) {
        if (operator.equalsIgnoreCase("+")) {
            return new AddOperator();
        }
        
        if (operator.equalsIgnoreCase("-")) {
            return new MinusOperator();
        }
        
        if (operator.equalsIgnoreCase("*")) {
            return new MultipleOperator();
        }
        
        if (operator.equalsIgnoreCase("/")) {
            return new DevideOperator();
        }
        
        return null;
    }
}
